<template>
   
  
    
  
    <el-dialog v-model="store.dialogFormVisible" title="请输入新用户信息">
      <el-form :model="form">
        <el-form-item label="id" :label-width="formLabelWidth">
          <el-input v-model="form.id" autocomplete="off" />
        </el-form-item>
        <el-form-item label="img" :label-width="formLabelWidth">
            <el-input v-model="form.img" autocomplete="off" />
          </el-form-item>
        <el-form-item label="姓名" :label-width="formLabelWidth">
            <el-input v-model="form.title" autocomplete="off" />
          </el-form-item>
          <el-form-item label="科室" :label-width="formLabelWidth">
            <el-input v-model="form.updata" autocomplete="off" />
          </el-form-item>
          <el-form-item label="职位" :label-width="formLabelWidth">
            <el-input v-model="form.type" autocomplete="off" />
          </el-form-item>
          <el-form-item label="医院" :label-width="formLabelWidth">
            <el-input v-model="form.type1" autocomplete="off" />
          </el-form-item>
          <el-form-item label="医院名" :label-width="formLabelWidth">
            <el-input v-model="form.type2" autocomplete="off" />
          </el-form-item>
          <el-form-item label="详情" :label-width="formLabelWidth">
            <el-input v-model="form.detail" autocomplete="off" />
          </el-form-item>
          <el-form-item label="账号" :label-width="formLabelWidth">
            <el-input v-model="form.zhanghao" autocomplete="off" />
          </el-form-item>
          <el-form-item label="密码" :label-width="formLabelWidth">
            <el-input v-model="form.mima" autocomplete="off" />
          </el-form-item>
          <el-form-item label="评价" :label-width="formLabelWidth">
            <el-input v-model="form.pingjia" autocomplete="off" />
          </el-form-item>
        <!-- <el-form-item label="Zones" :label-width="formLabelWidth">
          <el-select v-model="form.region" placeholder="Please select a zone">
            <el-option label="Zone No.1" value="shanghai" />
            <el-option label="Zone No.2" value="beijing" />
          </el-select>
        </el-form-item> -->
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="gb()">Cancel</el-button>
          <el-button type="primary" @click="qr(form)"
            >Confirm</el-button
          >
          <!-- {{store.dialogFormVisible}} -->
        </span>
      </template>
    </el-dialog>
  </template>
  
  <script  setup>
  import { reactive, ref } from 'vue'
  import {useCar} from "../store/car"


  import {onMounted,getCurrentInstance} from "vue"
  let {proxy}=getCurrentInstance()


    let store=useCar() 
    let gb = () => {
//   console.log("666");
store.dialogFormVisible = !store.dialogFormVisible;
};
let qr =async (arg) => {
//   console.log("666");
// store.dialogFormVisible = !store.dialogFormVisible;
let res=await proxy.$axios("/xjuser",{params:{...arg}})
console.log(res)
if(res.data.affectedRows==1){
  store.dialogFormVisible = !store.dialogFormVisible;
  alert("修改成功")
}

// const xj =async (arg, index) => {
//   // console.log(arg)
//        let res=await proxy.$axios("/xjuser",{params:{...arg}})
//       //  id:tableData.listdata.id,img:tableData.listdata.img,title:tableData.listdata.title,updata:tableData.listdata.updata,type:tableData.listdata.type
//        console.log(res)
//       //  if(res.data.affectedRows==1){
//       //   tableData.listdata.push(1)
//       //  }
// }

};
// let b=Boolean(store.dialogFormVisible)
//   const dialogFormVisible = ref(false)
  const formLabelWidth = '140px'
  
  const form = reactive({
    id: '',
    img: '',
    title: '',
    updata: '',
    type: ''
  })
  
  
  </script>
  <style scoped>
  .el-button--text {
    margin-right: 15px;
  }
  .el-select {
    width: 300px;
  }
  .el-input {
    width: 300px;
  }
  .dialog-footer button:first-child {
    margin-right: 10px;
  }
  </style>